<%@page import="java.util.Date"%>
<%@page import="cn.school.entity.Student"%>
<%@page import="cn.school.service.Service"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
	request.setCharacterEncoding("utf-8");
	String stuno=request.getParameter("stuno");
	String sname=request.getParameter("sname");
	String sex=request.getParameter("sex");
	String telephone=request.getParameter("telephone");
	String qq=request.getParameter("qq");
	String wechat=request.getParameter("wechat");
	String gradeid=request.getParameter("gradeid");
	SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
	Date enterdate=stu.getEnterdate();
	String enterDate="";
	if(enterdate!=null){
		enterDate=sdf.format(enterdate);
	}
	String fromcity=request.getParameter("fromcity");
	Date birthday=stu.getBirthday();
	String Birthday="";
	if(birthday!=null){
		Birthday=sdf.format(birthday);
	}
	String address=request.getParameter("address");
	String pass=request.getParameter("pass");
	
	Student stu=new Student(Long.parseLong(stuno),sname,sex,telephone,qq,wechat,Long.parseLong(gradeid),enterDate,fromcity,Birthday,address,pass);
	System.out.print(stu);
	Service s=new Service();
	int r = s.update(stu);
	if(r == 1){
		out.print("修改成功");
	}else{
		out.print("修改失败");
	} 
%>
</body>
</html>